﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="BookingTour1.aspx.cs" Inherits="BookingTour1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
     <script>
         $(document).ready(function () {
             $("span.login_booking").click(function () {
                 $("div.round-login-booking").slideDown(500);
                 //$("div.none-login").hide();
             });
             $("i.close-error").click(function () {
                 $("#body_lblerror").slideUp(300);
             });
         });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" Runat="Server">
    <div id="content-body-left">
        <!-- box tuor trong nuoc-->
        <div class="box-left">
            <div class="round-content">
                <div class="title-box-register">
                    <h2 class="title-text">
                        <asp:Label ID="Label1" runat="server" Text="Đặt Tour"></asp:Label></h2>
                </div>
                <div class="round-box-rigister">
                    <!-- dang ky thanh vien-->
                    <div id="tabs1" style="margin: 10px;">
                        <div class="login-error">
                            <asp:Label ID="lblerror" runat="server" Visible="False"></asp:Label>
                            <i class="close-error"></i>
                        </div>
                        <div class="customer_booking" id="customer_booking" runat="server">Nếu bạn đã là thành viên,<span class="login_booking"> nhấn vào đây </span>để đăng nhập </div>
                        <%--login neu da co tai khoan--%>
                        <div class="round-login-booking">
                            <table class="tbl-user-info">
                                <tbody>
                                    <tr>
                                        <td class="icon-col"><i class="sprite-be u-username"></i><span class="label">User name:</span></td>
                                        <td class="name-col">
                                            <div class="control-group">
                                                <asp:TextBox ID="Username" runat="server" CssClass="normal-input" ValidationGroup="login"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator27" runat="server" ErrorMessage="Chưa nhập username" ControlToValidate="Username" ForeColor="Red" ValidationGroup="login"></asp:RequiredFieldValidator>
                                                <%--<input name="hoten" type="text"  id="Text2" value="" >--%>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="icon-col"><i class="sprite-be u-password"></i><span class="label">Password:</span></td>
                                        <td class="name-col">
                                            <div class="control-group">
                                                <asp:TextBox ID="txtPassword" runat="server" CssClass="normal-input" TextMode="Password" ValidationGroup="login"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator28" runat="server" ErrorMessage="Chưa nhập Password" ControlToValidate="txtPassword" ForeColor="Red" ValidationGroup="login"></asp:RequiredFieldValidator>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" align="center">
                                            <%--   <input type="submit" class="blue-btn" value="Lưu thông tin">--%>
                                            <asp:Button ID="btnLogin" runat="server" Text="Đăng nhập" CssClass="blue-btn" ValidationGroup="login" OnClick="btnLogin_Click" />
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="none-login" id="nonelogin" runat="server">
                            <div class="text-booking">Thông tin liên hệ</div>
                            <table class="tbl-user-info">
                                <tbody>
                                    <tr>
                                        <td class="icon-col"><i class="sprite-be u-username"></i><span class="label">Họ tên:</span></td>
                                        <td class="name-col">
                                            <div class="control-group">
                                                <asp:TextBox ID="txtUsername" runat="server" CssClass="normal-input" ValidationGroup="tt"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Chưa nhập username" ControlToValidate="txtUsername" ForeColor="Red" ValidationGroup="tt"></asp:RequiredFieldValidator>
                                                <%--<input name="hoten" type="text"  id="Text2" value="" >--%>
                                            </div>
                                        </td>
                                    </tr>

                                    <tr>
                                        <td class="icon-col"><i class="sprite-be u-phone"></i><span class="label">Điện thoại:</span></td>
                                        <td class="name-col">
                                            <div class="control-group">
                                                <asp:TextBox ID="txtPhone" runat="server" CssClass="normal-input" ValidationGroup="tt"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="Chưa nhập điện thoại" ControlToValidate="txtPhone" ForeColor="Red" Display="Dynamic" ValidationGroup="tt"></asp:RequiredFieldValidator>
                                                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtPhone" Display="Dynamic" ForeColor="Red" ErrorMessage="Điện thoại chưa đúng" ValidationExpression="0\d{9,10}"></asp:RegularExpressionValidator>
                                            </div>
                                        </td>
                                    </tr>

                                    <tr>
                                        <td class="icon-col"><i class="sprite-be u-honnhan"></i><span class="label">Email:</span></td>
                                        <td class="name-col">
                                            <div class="control-group">
                                                <asp:TextBox ID="txtEmail" runat="server" CssClass="normal-input" ValidationGroup="tt"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="Chưa nhập email" ControlToValidate="txtEmail" ForeColor="Red" Display="Dynamic" ValidationGroup="tt"></asp:RequiredFieldValidator>
                                                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtEmail" Display="Dynamic" ForeColor="Red" ErrorMessage="Email sai định dạng" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="icon-col"><i class="sprite-be u-diachi"></i><span class="label">Địa chỉ:</span></td>
                                        <td class="name-col">
                                            <div class="control-group">
                                                <asp:TextBox ID="txtAddress" runat="server" CssClass="normal-input" ValidationGroup="tt"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ErrorMessage="Chưa nhập địa chỉ" ControlToValidate="txtAddress" ForeColor="Red" ValidationGroup="tt"></asp:RequiredFieldValidator>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="icon-col"><i class="sprite-be icon-ngaysinh"></i><span class="label">Ngày đi:</span></td>
                                        <td class="name-col">
                                            <asp:TextBox ID="txtNgaydi" runat="server" CssClass="normal-input input-small date" ValidationGroup="tt"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="Chưa chọn ngày đi" ControlToValidate="txtNgaydi" ForeColor="Red" ValidationGroup="tt"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="icon-col"><i class="sprite-be u-diachi"></i><span class="label">Yêu cầu khác:</span></td>
                                        <td class="name-col">
                                            <div class="control-group">
                                                <asp:TextBox ID="notes" TextMode="MultiLine" runat="server" CssClass="normal-input" Rows="5" ValidationGroup="tt"></asp:TextBox>
                                            </div>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <%-- danh sách khách hàng đi tour--%>
                                <div class="text-booking go-tour">Số lượng khách hàng đi tour</div>
                                <table class="tbl-user-info">
                                    <tbody>
                                        <tr>
                                            <td class="icon-col" style="width: 200px;"><i class="sprite-be u-username"></i><span class="label">Bạn cần đi bao nhiêu người? </span></td>
                                            <td class="name-col">
                                                <div class="control-group">
                                                    <label>Người lớn:</label>
                                                    <asp:HiddenField ID="HiddenField1" runat="server" />
                                                    <asp:TextBox ID="txtNguoiLon" runat="server" CssClass="txt-soluong" ></asp:TextBox> &nbsp;&nbsp;&nbsp;&nbsp;
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtNguoiLon" ErrorMessage="Vui lòng nhập vào số người đi" ValidationGroup="tt" Display="Dynamic" ForeColor="Red"></asp:RequiredFieldValidator>
                                                    <asp:CompareValidator ID="CompareValidator1" runat="server" ErrorMessage="số lượng tối thiểu là 1" ControlToValidate="txtNguoiLon" ValueToCompare="0" Display="Dynamic" Operator="GreaterThan" Type="Integer"></asp:CompareValidator>
                                                    <label>Trẻ em:</label>
                                                    <asp:HiddenField ID="HiddenField2" runat="server" />
                                                    <asp:TextBox ID="txtTreEm" runat="server" CssClass="txt-soluong"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;
                                                    <label>Trẻ nhỏ:</label>
                                                    <asp:HiddenField ID="HiddenField3" runat="server" />
                                                    <asp:TextBox ID="txtTreNho" runat="server" CssClass="txt-soluong"></asp:TextBox>
                                                </div>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                        <table class="tbl-user-info">
                                    <tbody>
                                        <tr>
                                            <td class="icon-col" style="width: 200px;"><i class="sprite-be u-username"></i><span class="label">Bạn cần bao nhiêu phòng đơn? </span></td>
                                            <td class="name-col">
                                                <div class="control-group">
                                                    <%--<input name="hoten" type="text"  id="Text2" value="" >--%>
                                                    <asp:TextBox ID="txtPhongDon" runat="server" CssClass="txt-soluong" Text="0"></asp:TextBox> &nbsp;&nbsp;&nbsp;&nbsp;
                                                   
                                                </div>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                                <br />
                         <table class="tbl-user-info">
                                    <tbody>
                                        <tr>
                                            <td class="icon-col" style="width: 200px;"><i class="sprite-be u-username"></i><span class="label">Tổng tiền: </span></td>
                                            <td class="name-col">
                                                <div class="control-group">
                                                   <asp:TextBox ID="txtTotal" runat="server" Enabled="true"></asp:TextBox>
                                                   
                                                </div>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
 
                        <div class="btn-tt">
                            <asp:Button ID="btn_next" runat="server" Text="TIẾP TỤC" CssClass="btn-dt" ValidationGroup="tt" OnClick="btn_next_Click" />
                        </div>

                        <!-- end dang ky thanh vien-->
                    </div>

                </div>
            </div>
        </div>
    </div>
    <script>
        $(document).ready(function () {
            $("#body_txtNguoiLon,#body_txtTreEm,#body_txtTreNho,#body_txtPhongDon").blur(function () {

                //lay so luong khach hang nhap vao
                slnl = $("#body_txtNguoiLon").val();
                slte = $("#body_txtTreEm").val();
                sltn = $("#body_txtTreNho").val();
                slpd = $("#body_txtPhongDon").val();
                
                //lay gia cua loai khach
                gianguoilon = $("#body_HiddenField1").val();
                giatreem = $("#body_HiddenField2").val();
                giatrenho = $("#body_HiddenField3").val();
                giapd = 800000;
                // tinh tien
                tong = 0;
                if (slnl > 0) {
                    tong = slnl * gianguoilon;
                }
                else { tong = gianguoilon; }
                if (slte > 0)
                {
                    tong += slte * giatreem;
                }
                if(sltn >0)
                {
                    tong += sltn * giatrenho;
                }
                if (slpd > 0)
                {
                    tong += slpd * giapd;
                }
               // alert(tong);
                $("#body_txtTotal").val(tong).priceFormat({ prefix: '', suffix: ' đ', centsLimit: 0, thousandsSeparator: '.' });
            });
            
        });
    </script>
</asp:Content>

